home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / documents / OpenGL / opengldoc / glspec / import_context.spec < prev    next >
Encoding:
Text File  |  1996-11-11  |  5.5 KB  |  195 lines

  1. Name
  2.  
  3.     EXT_import_context
  4.  
  5. Name Strings
  6.  
  7.     GLX_EXT_import_context
  8.  
  9. Version
  10.  
  11.     $Date: 1996/04/01 23:22:56 $ $Revision: 1.1 $
  12.  
  13. Number
  14.  
  15.     47
  16.  
  17. Dependencies
  18.  
  19.     This extension affects the definition of SGIX_FBConfig.
  20.  
  21. Overview
  22.  
  23.     This extension allows multiple X clients to share an indirect
  24.     rendering context.
  25.  
  26.     Additional convenience procedures to get the current Display*
  27.     bound to a context as well as other context information are
  28.     also added.
  29.  
  30. Issues
  31.  
  32.     Does glXImportGLXContext also need to take an XVisualInfo*?
  33.         No.  This information will be retrieved from the server.
  34.  
  35. New Procedures and Functions
  36.  
  37.     Display *glXGetCurrentDisplayEXT();
  38.  
  39.     int glXQueryContextInfoEXT(Display *dpy, GLXContext context, 
  40.                     int attribute,int *value);
  41.  
  42.     GLXContextID glXGetContextIDEXT(const GLXContext context);
  43.  
  44.     GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID);
  45.  
  46.     void glXFreeContextEXT(Display *dpy, GLXContext context);
  47.  
  48. New Tokens
  49.  
  50.     Accepted by the <attribute> parameter of glXQueryContextInfoEXT:
  51.  
  52.         GLX_SHARE_CONTEXT_EXT        0x800A
  53.         GLX_VISUAL_ID_EXT            0x800B
  54.         GLX_SCREEN_EXT            0x800C
  55.  
  56. Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
  57.  
  58.     None
  59.  
  60. Additions to Chapter 3 of the 1.0 Specification (Rasterization)
  61.  
  62.     None
  63.  
  64. Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations
  65. and the Frame Buffer)
  66.  
  67.     None
  68.  
  69. Additions to Chapter 5 of the 1.0 Specification (Special Functions)
  70.  
  71.     None
  72.  
  73. Additions to Chapter 6 of the 1.0 Specification (State and State Requests)
  74.  
  75.     None
  76.  
  77. Additions to the GLX Specification
  78.  
  79.     [Add the following to Section 3.2.4 of the GLX Specification
  80.     (Rendering Contexts)]
  81.  
  82.     To get the display associated with the current context, use
  83.  
  84.         Display *glXGetCurrentDisplayEXT();
  85.  
  86.     If there is no current context, NULL is returned. No round trip
  87.     is forced to the server; unlike most X calls that return a value,
  88.     glXGetCurrentDisplayEXT does not flush any pending events.
  89.  
  90.     To obtain the value of a context's attribute, use
  91.  
  92.         int glXQueryContextInfoEXT(Display *dpy, GLXContext context, 
  93.                        int attribute, int *value);
  94.  
  95.     glxQueryContextInfoEXT returns through <value> the value of
  96.     <attribute> for <context>.  It may cause a round trip to the
  97.     server.
  98.  
  99.     The values and types corresponding to each GLX context attribute 
  100.     are listed in the table below.
  101.  
  102.     GLX context attribute      type    context information
  103.     ---------------------   ----    -------------------
  104.     GLX_SHARE_CONTEXT_EXT    XID       xid of the share list context
  105.     GLX_VISUAL_ID_EXT    XID    visual id
  106.     GLX_SCREEN_EXT        int    screen number
  107.  
  108.     glxQueryContextInfoEXT returns GLX_BAD_ATTRIBUTE if <attribute> 
  109.     is not a valid GLX context attribute or GLX_BAD_CONTEXT if <context>
  110.     is invalid, otherwise it returns Success.
  111.  
  112.     To obtain the XID of a GLXContext, use
  113.  
  114.         GLXContextID glXGetContextIDEXT(const GLXContext context);
  115.  
  116.     No round trip is forced to the server; unlike most X calls that
  117.     return a value, glXGetContextIDEXT does not flush any
  118.     pending events.
  119.  
  120.     To create a GLXContext given the XID of an existing GLXContext, use
  121.  
  122.         GLXContext glXImportContextEXT(Display *dpy, 
  123.                        GLXContextID contextID);
  124.  
  125.     glXImportContextEXT may be used in place of glXCreateContext to 
  126.     share another process's indirect rendering context. 
  127.  
  128.         Only the server-side context information can be shared between
  129.         X clients; client-side state, such as pixel storage modes,
  130.         cannot be shared. Thus, glXImportContextEXT, must allocate
  131.         memory to store client-side information. This memory is freed
  132.         by calling  glXFreeContextEXT.
  133.  
  134.     This call does not create a new XID.  It merely makes an
  135.     existing object available to the importing client (Display *).
  136.     Like any XID, it goes away when the creating client drops its
  137.     connection or the ID is explicitly deleted. Note that this is
  138.     when the XID goes away. The object goes away when the XID
  139.     goes away AND the context is not current to any thread.
  140.  
  141.         If <contextID> does not refer to a valid context, then
  142.         a BadContext error is generated; if <contextID> refers to
  143.         direct rendering context then no error is generated but
  144.         glXImportContextEXT returns NULL.
  145.  
  146.     To free the client-side part of a GLXContext that was created 
  147.     with glXImportContext, use
  148.  
  149.         void glXFreeContextEXT(Display *dpy, GLXContext context);
  150.  
  151.         glXFreeContext does not free the server-side context information
  152.         or the XID associated with the server-side context.
  153.  
  154.         [Add the following clarification to glXMakeCurrent]
  155.  
  156.         Change:
  157.        If <context> is current to some other thread, then glXMakeCurrent 
  158.        will generate a BadAccess error.
  159.       
  160.         To:
  161.        If <context> is current to some other thread or process, then 
  162.        glXMakeCurrent will generate a BadAccess error.
  163.  
  164. GLX Protocol
  165.  
  166.     One new GLX protocol command is added.
  167.  
  168.         QueryContextInfo
  169.             1           CARD8           opcode (X assigned)
  170.             1           17              GLX opcode (glXVendorPrivateWithReply)
  171.             2           4                 request length
  172.             4           15              vendor specific opcode
  173.             4           unused          corresponds to context tag in header
  174.             4           GLX_CONTEXT     context id
  175.            =>
  176.             1           1               Reply
  177.             1                           unused
  178.             2           CARD16          sequence number
  179.         4        2*n        reply length
  180.             4           CARD32         n
  181.             20                          unused
  182.         8*n        LISTofCARD32    attribute, value pairs
  183.  
  184. Errors
  185.  
  186.     None
  187.  
  188. New State
  189.  
  190.         None
  191.  
  192. New Implementation Dependent State
  193.  
  194.     None
  195.